#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QWidget>
#include <QIcon>
namespace Ui
{
    class ConfigGUI;
}
class QMouseEvent;
class ConfigGUI : public QWidget
{
    Q_OBJECT
public:
    enum ResizeDirection {
        None,
        Move,
        TopLeft,
        TopRight,
        BottomLeft,
        BottomRight,
        Left,
        Right,
        Top,
        Bottom
    };
    explicit ConfigGUI(QWidget *parent = nullptr);
    ~ConfigGUI();
    void AddLog(const QString& log);
protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    ResizeDirection getResizeDirection(const QMouseEvent *event);
    void ddd(ConfigGUI::ResizeDirection r);
    void saveConfigCB(bool isOk,const std::string&);
protected slots:
    void onNormalButtonClicked();
    void onMaximizeButtonClicked();
    void onBtnRefresh();
    void onBtnAddConfig();
    void onBtnDelConfig();
    void onBtnEditConfig();//btnEditConfig
    
protected:
    Ui::ConfigGUI *ui;

    bool m_bMousePress;
    QPoint m_ptPress;
    QPoint m_ptLocalPress;
    ResizeDirection m_resizeDirection;
    QRect m_originalGeometry;
};

#endif // MAINWINDOW_H
